code vault - mystrtokWhat links here?

Code



//##############################################################################
// parse the given string into tokens
// strings within single quotes (') are considered a single token
// if called with string == NULL, it starts where it left off last call
//##############################################################################
char *mystrtok(char *string, char *delimiters)
{
    static char    *work;
    char           *start;
    int             in_quotes;
    
    if (string != NULL) work = string;
    in_quotes = 0;


if (!(*work)) return (NULL); start = work; /* move forward looking for the next character in delimiters */ while (*work) { if (strchr(delimiters, *work) && !in_quotes) break; if (*work == 0x27) in_quotes = in_quotes ? 0 : 1; work++; }; // replace the delimiter with '\0' to signal end of the string if (*work) { *work = '\0'; work++; } return (start); }
code vault - mystrtok
filename:code vault - mystrtok
filename:code%20vault%20%2D%20mystrtok
last edit:March 26 2009 18:59:10 (5518 days ago)
ct = 1714946040.000000 = May 05 2024 17:54:00
ft = 1238108350.000000 = March 26 2009 18:59:10
dt = 476837690.000000